package org.wk.upms.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.wk.upms.dao.ManagerRoleDao;
import org.wk.upms.domain.ManagerRoleEntity;

import java.util.ArrayList;
import java.util.List;

@Service
public class ManagerRoleServiceImpl implements ManagerRoleService{
    @Autowired
    private ManagerRoleDao managerRoleDao;

    @Override
    public List<String> queryRoleIdList(String userId) {

        List<ManagerRoleEntity> managerRoleEntities = managerRoleDao.findByManagerId(userId);
        List<String> resData = new ArrayList<>();
        if (managerRoleEntities!=null || !managerRoleEntities.isEmpty()) {
            for (ManagerRoleEntity entity : managerRoleEntities) {
                resData.add(entity.getRoleId());
            }
        }
        return resData;
    }
}
